package uk.co.droidinactu.sony.prst1.home.data;

import android.content.ContentValues;
import android.database.Cursor;

public final class Collection extends AbstractDataObj {

	public static String COLUMN_NAME_KANA_TITLE = "kana_title";
	public static String COLUMN_NAME_SOURCE_ID = "source_id";
	/**
	 * The name of the column in the database used to store the modified
	 * date/time.
	 */
	public static String COLUMN_NAME_TITLE = "title";
	public static String COLUMN_NAME_UUID = "uuid";

	public String kana_title;
	public long source_id;
	public String title;
	public String uuid;

	public Collection() {
		// TODO Auto-generated constructor stub
	}

	public Collection(final Cursor tmpCursor) {
		super(tmpCursor);
		try {
			title = tmpCursor.getString(tmpCursor.getColumnIndex(COLUMN_NAME_TITLE));
		} catch (final Exception e) {
		}
		try {
			kana_title = tmpCursor.getString(tmpCursor.getColumnIndex(COLUMN_NAME_KANA_TITLE));
		} catch (final Exception e) {
		}
		try {
			source_id = tmpCursor.getLong(tmpCursor.getColumnIndex(COLUMN_NAME_SOURCE_ID));
		} catch (final Exception e) {
		}
		try {
			uuid = tmpCursor.getString(tmpCursor.getColumnIndex(COLUMN_NAME_UUID));
		} catch (final Exception e) {
		}
	}

	@Override
	public ContentValues getContentValues() {
		final ContentValues map = super.getContentValues();
		map.put(COLUMN_NAME_TITLE, title);
		map.put(COLUMN_NAME_KANA_TITLE, kana_title);
		map.put(COLUMN_NAME_SOURCE_ID, source_id);
		map.put(COLUMN_NAME_UUID, uuid);
		return map;
	}

	@Override
	public String getTableName() {
		return "Collection";
	}

	@Override
	public String toString() {
		return "collection: " + title;
	}

}
